<?php
class DashboardController extends AppController {
	
	var $name = 'Dashboard';
	var $uses = array ();
	var $helpers = array ('Js' => 'Jquery','GoogleChart','Html');
	
	function beforeRender() {
	}
	function index() {
		$Store = ClassRegistry::init ( 'Store' );
		$this->set ( 'listAvailable', $Store->find ( 'all', array ('conditions' => array ('Store.in_store' > 0 ) ) ) );
		$this->set ( 'recentCar', $Store->getRecentBuy () );
		$this->set ( 'recentSales', $Store->getRecentSales () );
		$this->set ( 'pendingDocs', $Store->getDocPending () );
		$this->set ( 'cntAvailable', $Store->getCountAvailable () );
		$this->set ( 'cntSalesMonthly', $Store->getSalesMonthly () );
		$this->set ( 'cntPendingDocs', count ( $Store->getDocPending () ) );
		$this->set ( 'data', $Store->Sale->getSalesRepByYear () );
		$this->set('repSalesByType',$Store->Sale->getSalesRepByType());
	
	}
	function test() {
		$this->layout = null;
		$this->autoLayout = false;
		Configure::write ( 'debug', '0' );
	}
}

?>
